{
 "cells": [
  {
   "cell_type": "markdown",
   "source": [
    "## 导入模块"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "576e2c1d9568c21b"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "2a266a0fbe7ae3c6"
  },
  {
   "cell_type": "markdown",
   "source": [
    "## 三角函数\n",
    "\n",
    "### 正弦函数"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "540d10fb2f235a2c"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "# 生成 x 值\n",
    "x = np.linspace(-1 * np.pi, 1 * np.pi, 1000)\n",
    "# 计算正弦函数的 y 值\n",
    "y = np.sin(x)\n",
    "\n",
    "# 绘制图像\n",
    "plt.plot(x, y, label='sin(x)')\n",
    "# 设置图像标题、标签和图例\n",
    "plt.title('Sin Function')\n",
    "plt.xlabel('x')\n",
    "plt.ylabel('y')\n",
    "plt.grid(color = 'gray', linestyle = '--', linewidth = 0.5)\n",
    "plt.legend()\n",
    "\n",
    "plt"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "e831c7bcee54cf1f"
  },
  {
   "cell_type": "markdown",
   "source": [
    "### 余弦函数"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "cae333a3bed32b17"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "x = np.linspace(-1 * np.pi, 1 * np.pi, 1000)\n",
    "y = np.cos(x)\n",
    "\n",
    "plt.plot(x, y, label='cos(x)')\n",
    "plt.title('Cos Function')\n",
    "plt.xlabel('x')\n",
    "plt.ylabel('y')\n",
    "plt.grid(color = 'gray', linestyle = '--', linewidth = 0.5)\n",
    "plt.legend()\n",
    "\n",
    "plt"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "e67f2e27d503c78"
  },
  {
   "cell_type": "markdown",
   "source": [
    "### 正切函数"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "ab8981923e4c0b9f"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "x = np.linspace(-1 * np.pi, 1 * np.pi, 1000)\n",
    "y_tan = np.tan(x)\n",
    "\n",
    "plt.plot(x, y_tan, label='tan(x)')\n",
    "plt.title('Tangent Function')\n",
    "plt.xlabel('x')\n",
    "plt.ylabel('y')\n",
    "plt.grid(color = 'gray', linestyle = '--', linewidth = 0.5)\n",
    "plt.legend()\n",
    "\n",
    "plt"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "1cc0fcef675fd21e"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   },
   "id": "618346d7bf7dd07e"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
